import qs from 'qs'
import http from '../libs/http'

const basicRoute = '/api/organization'


export const getOrganizationList = (params) => {
    return http.get(basicRoute, {
        params
    })
}

export const getOrganizationAll = (params) =>{
    return http.get(`${basicRoute}/getlist`, {
        params
    })
}

export const getOrganizationHomeAll = (params) =>{
    return http.get('api/getOrganizationHomeList', {
        params
    })
}

export const addOrganization = (data) => {
    return http.post(basicRoute, data)
}

export const editOrganization = (id, data) => {
    return http.patch(`${basicRoute}/${id}`, qs.stringify(data))
}

export const getOrganizationData = (id) => {
    return http.get(`${basicRoute}/${id}/edit`)
}
export const updateOrganization = (id, data) => {
    return http.patch(`${basicRoute}/${id}`, qs.stringify(data))
}

export const deleteOrganization = id => {
    return http.delete(`${basicRoute}/${id}`)
}
